#!/usr/bin/env python3
# -*- encoding: utf-8 -*-
"""
@File    :   数字提取.py
@Time    :   2023-04-03 11:39
@Author  :   坐公交也用券
@Version :   1.0
@Contact :   liumou.site@qq.com
@Homepage : https://liumou.site
@Desc    :   当前文件作用
"""
import re
txt = """PING baidu.com (39.156.66.10) 56(84) bytes of data.
64 bytes from 39.156.66.10 (39.156.66.10): icmp_seq=1 ttl=47 time=44.3 ms
64 bytes from 39.156.66.10 (39.156.66.10): icmp_seq=2 ttl=47 time=43.3 ms
64 bytes from 39.156.66.10 (39.156.66.10): icmp_seq=3 ttl=47 time=43.3 ms

--- baidu.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 4ms
rtt min/avg/max/mdev = 43.305/43.646/44.302/0.522 ms"""
p = r"(\d+)(% )"
m = re.findall(p, txt)
print(m[0][0])